//=====================================================
/*
* @file    Singleton.h
*
* @date    2012-12-04
*
* @author  jianmengai@gmail.com
*
* @version 0.1
*/
//=====================================================

#ifndef _INCLUDE_SINGLETON_H
#define _INCLUDE_SINGLETON_H

#include <pthread.h>

template <typename T>
class Singleton
{
public:
    static T* instance();
    static void cleanup();
private:
    Singleton()
    {
    }
    ~Singleton()
    {
    }
private:
    static T*              instance_;
    static pthread_mutex_t mutex_;
};

#include "Singleton_T.cpp"

#endif
